Android Studio常见问题

Android Studio使用建议:将SDK Manager里面的相关工具提前下载下来,并定期更新

  • Tools目录:全部下载(包括SDK Tools、SDK Platform-tools、SDK Build-tools
  • 各个版本的Android SDK:按需下载,一般下载SDK Platform、Documentation、APIs、Sources
  • Extras目录:Android Support Repository、Android Support Library、Google Repository

1. Gradle版本问题

1
2
3
4
5
6
7
8
9
10
11
12
13
Error:A problem occurred configuring root project 'XylqPda'.
> Could not resolve all dependencies for configuration ':classpath'.
> Could not resolve com.android.tools.build:gradle:2.0.0.
Required by:
:XylqPda:unspecified
> Could not resolve com.android.tools.build:gradle:2.0.0.
> Could not get resource 'https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.0.0/gradle-2.0.0.pom'.
> Could not GET 'https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.0.0/gradle-2.0.0.pom'.
> peer not authenticated
> Could not resolve com.android.tools.build:gradle:2.0.0.
> Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle/2.0.0/gradle-2.0.0.pom'.
> Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle/2.0.0/gradle-2.0.0.pom'.
> peer not authenticated

原因分析

一般为Android Studio版本号和Gradle版本号不一致导致。

解决方法

将项目根目录下的build.gradle中dependencies内的

1
classpath 'com.android.tools.build:gradle:2.1.2'

版本号设为跟Android Studio版本号一致。

2. 下载Build-tools失败

1
2
Error:failed to find Build Tools revision 24.0.1
Install Build Tools 24.0.1 and sync project

http://blog.csdn.net/barryhappy/article/details/44813951

3. 更新 Gradle 错误

停止在Refreshing Gradle Project ,有时新建项目的时候报 Gradle Project Compile Error 等等相关的问题
http://www.cnblogs.com/neozhu/p/3525404.html

感谢你的支持,让我继续努力分享有用的技术和知识点!